package com.smh.yunpicturebackend.utils;

import com.smh.yunpicturebackend.pojo.domain.User;

/**
 * @author shiminghui
 * @date 2025/6/14 21:15
 * @description: 线程本地存储用户信息
 */
public class UserThreadLocal {
    private static final ThreadLocal<User> USER_THREAD_LOCAL = new ThreadLocal<>();
    public static void set(User user) {
        USER_THREAD_LOCAL.set(user);
    }
    public static User get() {
        return USER_THREAD_LOCAL.get();
    }
    public static void remove() {
        USER_THREAD_LOCAL.remove();
    }

}
